using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Nullables;

namespace Sedna.Core.Controller.Configurations
{
    public class DateTime2NullableParser : IDataTranslator
    {
        public object Translate(Control control, object value)
        {
            return Translate(control, value, null);
        }

        public object Translate(Control control, object value, Type targetType)
        {
            return (value != null) ? new NullableDateTime(Convert.ToDateTime(value)) : null;
        }
    }
}
